All Functions of Week 2

filter

{dplyr}

Filter out rows of a data frame according to logical vector

as.data.frame

{base}

Functions to check if an object is a data frame, or coerce it if possible.

data.frame

{base}

Create a data.frame from vectors

ifelse

{base}

Return a or b depending on the value of test

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

summary

{base}

Obtain summary statistics or detailed regression output

plot

{graphics}

Generic function from base R to produce a plot

par

{graphics}

Set parameters of the plotting device

seq

{base}

Create a sequence

expression

{base}

Used in plots to add symbols to axes

bar

{base}

Used for annotations, such as “expression(paste(”-“,bar(y)))”

rnorm

{base}

Generate random numbers from a normal distribution

nobs

{gdata}

Compute the number of non-missing observations

sample

{base}

Takes a sample of the specified size

dnorm

{stats}

Density distribution for the normal distribution

log

{base}

log (default base = e)

ggsave

{ggplot2}

Saves the last ggplot or a specified ggplot object to a file

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

which

{base}

return indexes of TRUE entries of a logical vector

lm

{base}

Fit a linear model

mean

{base}

Get mean of a vector

c

{base}

Combine values/vectors into a vector

library

{base}

Load an R package

as.character

{base}

Coerce a vector to character

The end!